package com.jiadakeji.ppm.modules.weixin.entity;



import com.jiadakeji.ppm.common.utils.IdGen;
import com.jiadakeji.ppm.common.utils.WechatUtils;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "xml")//xml的根元素
public class WechatPayRefundRequest implements Serializable {
    private String appid;//服务商ID 是 可用map
    private String mch_id;//商户号 是
    private String nonce_str;
    private String sign;
    private String out_trade_no;
    private String out_refund_no;
    private String total_fee;
    private String refund_fee;
    private String refund_fee_type;
    private String refund_account;
    private String notify_url;

    public WechatPayRefundRequest(){
        this.appid = WechatUtils.appid;//公众号appid  佳达
        this.mch_id =WechatUtils.mch_id;//服务商商号

        this.notify_url = WechatUtils.RefundNotifyUrl;//支付回调url TODO 使用配置文件
        this.nonce_str = IdGen.uuid();//32位随机字符串
    }

   /* public void setMassege(OrderRefund orderRefund){
        this.out_trade_no = orderRefund.getOrderCode();
        this.out_refund_no = orderRefund.getRefundCode();
        Double totalPriceDouble = orderRefund.getTotalPrice()*1000/10;
        String totalPrice =   String.valueOf((Integer)totalPriceDouble.intValue());
        this.total_fee = totalPrice;
        Double refundFeeDouble = orderRefund.getPrice()*1000/10;
        String refundFee = String.valueOf((Integer)refundFeeDouble.intValue());
        this.refund_fee = refundFee;
    }*/

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getMch_id() {
        return mch_id;
    }

    public void setMch_id(String mch_id) {
        this.mch_id = mch_id;
    }

    public String getNonce_str() {
        return nonce_str;
    }

    public void setNonce_str(String nonce_str) {
        this.nonce_str = nonce_str;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }



    public String getOut_trade_no() {
        return out_trade_no;
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getOut_refund_no() {
        return out_refund_no;
    }

    public void setOut_refund_no(String out_refund_no) {
        this.out_refund_no = out_refund_no;
    }

    public String getRefund_fee_type() {
        return refund_fee_type;
    }

    public void setRefund_fee_type(String refund_fee_type) {
        this.refund_fee_type = refund_fee_type;
    }

    public String getRefund_account() {
        return refund_account;
    }

    public void setRefund_account(String refund_account) {
        this.refund_account = refund_account;
    }

    public String getNotify_url() {
        return notify_url;
    }

    public void setNotify_url(String notify_url) {
        this.notify_url = notify_url;
    }



    public String getTotal_fee() {
        return total_fee;
    }

    public void setTotal_fee(String total_fee) {
        this.total_fee = total_fee;
    }

    public String getRefund_fee() {
        return refund_fee;
    }

    public void setRefund_fee(String refund_fee) {
        this.refund_fee = refund_fee;
    }
}
